<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{date | format('yyyy-MM-dd')}}</div>
    </div>
    <script src="../vue.min.js"></script>
    <script>
        Vue.filter('format', function (value, arg) {
            if (arg == 'yyyy-MM-dd') {
                var ret = ''
                ret += value.getFullYear() + '-' + (value.getMonth() + 1) + '-' + value.getDate();
                return ret
            }
            return value;
        })
        var app = new Vue({
            el: '#app',
            data: {
                date: new Date()
            }
        })
    </script>
</body>

</html>